package com.huawei.appmarket.support.audio;

import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import o.dky.j;
import o.doo;
import o.epe;
import o.epn;
import o.NetWorkUtil;
import o.evk;

public class AudioPlayReceiver extends SafeBroadcastReceiver {
    private int ˏ;

    public void onReceiveMsg(Context context, Intent intent) {
        String action = intent.getAction();
        if (action != null) {
            Object obj = -1;
            switch (action.hashCode()) {
                case -2128145023:
                    if (action.equals("android.intent.action.SCREEN_OFF")) {
                        obj = 2;
                        break;
                    }
                    break;
                case -1454123155:
                    if (action.equals("android.intent.action.SCREEN_ON")) {
                        obj = 1;
                        break;
                    }
                    break;
                case -1172645946:
                    if (action.equals("android.net.conn.CONNECTIVITY_CHANGE")) {
                        obj = null;
                        break;
                    }
                    break;
                case -19011148:
                    if (action.equals("android.intent.action.LOCALE_CHANGED")) {
                        obj = 3;
                        break;
                    }
                    break;
                case 562127767:
                    if (action.equals("com.huawei.systemmanager.action.CHANGE_HOME_COUNTRY")) {
                        obj = 4;
                        break;
                    }
                    break;
            }
            switch (obj) {
                case null:
                    ˊ(context);
                    return;
                case 1:
                    epn.ˎ().ॱ();
                    return;
                case 2:
                    epn.ˎ().ᐝ();
                    return;
                case 3:
                    epn.ˎ().ˊ();
                    epe.ˏ().ʽ(7);
                    epe.ˏ().ˊ();
                    return;
                case 4:
                    epe.ˏ().ʽ(7);
                    epe.ˏ().ˊ();
                    return;
                default:
                    return;
            }
        }
    }

    private void ˊ(Context context) {
        if (context != null) {
            int ˊ = doo.ˊ(((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo());
            if (ˊ != this.ˏ) {
                this.ˏ = ˊ;
                boolean ʻ = epe.ˏ().ʻ();
                if (!doo.ͺ(context) || !ʻ) {
                    return;
                }
                if (epe.ˏ().ॱॱ()) {
                    epe.ˏ().ˊ(7);
                } else {
                    ˋ(context);
                }
            }
        }
    }

    private void ˋ(Context context) {
        evk.ˋ(context, NetWorkUtil.getWifiResId(context, j.ʻ), 0).ˋ();
    }
}
